12. Features of Specialized Frameworks

Features of Specialized Frameworks

Features of Specialized Frameworks

Most frameworks have a common set of features, but not all frameworks are created equal. Some are more specialized and offer more functionality. When choosing a framework for a project, do your research to make sure you're picking the right one for the job.

Custom Elements

Some frameworks let you create your own custom elements. Custom elements have been a request for a long time, but the spec is still not stable. Frameworks like Angular and Ember give us the ability to create our own custom HTML elements. If you're creating a blog template, wouldn't it be easier and more clear to have a <user-bio> element:

<user-bio>
    <h3>Richard</h3>
    <img src="img/richard_profile.jpg" alt="Richard's profile picture">
    <p>Before working at Udacity, Richard...
</user-bio>

Instead of trying to decipher what this is:

<div> 
    <h3>Richard</h3>
    <img src="img/richard_profile.jpg" alt="Richard's profile picture">
    <p>Before working at Udacity, Richard...
</div>

Updating the DOM

When an app's data changes, the template (and therefore the DOM) needs to change. DOM insertion and manipulation is an extremely slow process. Some frameworks, provide a feature called Virtual DOM to alleviate this problem. The framework will create a Virtual DOM in memory, and perform all of the necessary updates or deletions to this in-memory structure. Then it will convert VirtualDOM to real DOM and replace the existing content.

Fullstack Frameworks

We've been looking at front end frameworks. But there are full stack frameworks that live on both the client and the server. When a framework lives on both ends of the spectrum, it can handle things like data streaming. Meteor is a full stack framework that uses web sockets to keep an open connection between client and server. This provides for faster communication and a smoother user experience.

When choosing a framework, there are a lot of features and capabilities to sift through. Make sure to try out several different frameworks to know what each one has to offer.